﻿#include "CoordsCommand.h"

#include "../../../Memory/GameData.h"

bool CoordsCommand_onExecute(const fast_io::vector<std::u8string>& args) {
	if (args.size() != 1) 
		return false;
	vec3_t pos = *GameData::getLocalPlayer()->getPos();
	pos.y -= 1.62f;
	C_GuiData::displayClientMessageC(Utils::TextColor::LIGHT_PURPLE,
											   u8"[Helium] ",
											   Utils::TextColor::YELLOW,
											   u8"X = ",
											   fast_io::mnp::fixed(pos.x),
											   u8" Y = ",
											   fast_io::mnp::fixed(pos.y),
											   u8" Z = ",
											   fast_io::mnp::fixed(pos.z));
	return true;
}

ICommand CoordsCommand{
	u8"coords",
	u8".coords or .pos",
	{u8"get current coordinates", u8"获取当前坐标", u8"獲取當前坐標", u8"現在の座標を取得する"},
	{u8"pos"},
	fast_io::vector<aliasList_struct>{},  // If empty must use fast_io::vector<aliasList_struct>{}
	nullptr,
	&CoordsCommand_onExecute};